<?php
class Solicitudes_Form_Docentesvisita extends Form_Cna {

    public function __construct($options = null) {
        parent::__construct($options);
    }

    public function init() {
        $domConfig = Zend_Registry::get('domConfig'); //esto se crea en el bootstrap
        $this->setName('instalaciones');
        $this->setMethod("post");
        $this->setAttrib('enctype', 'multipart/form-data');
        $tableareas = new Generales_Model_Areas();
        $areas = $tableareas->getarrayAreas(-3);
        
        $array_elements[] = new Zend_Form_Element_Hidden("codtab");
        $array_elements[] = new Zend_Form_Element_Hidden("codboton");
        $array_elements[] = new Zend_Form_Element_Hidden("codboton2");
        $array_elements[] = new Zend_Form_Element_Hidden("coddocentevisita");

        $element = new Zend_Form_Element_Text("nombres");
	    $element->setLabel("Nombres : ");
	    $element->setRequired(true);
	    $element->addFilter('StripTags');
	    $element->addFilter('StringTrim');
//	    $element->addFilter('StringToUpper');
	    $element->setAttribs(array('size'=>50));
	    $array_elements[] = $element;
	    
        $element = new Zend_Form_Element_Text("apellidos");
	    $element->setLabel("Apellidos : ");
	    $element->setRequired(true);
	    $element->addFilter('StripTags');
	    $element->addFilter('StringTrim');
//	    $element->addFilter('StringToUpper');
	    $element->setAttribs(array('size'=>50));
	    $array_elements[] = $element;
        
		$element = new Zend_Form_Element_Select('codclasificacionarea');
		$element->setLabel("Área del conocimiento :");
		$element->setRegisterInArrayValidator(false);
		$element->addMultiOption(null, "-- Seleccione --");
		$element->addMultiOptions($areas);
        $element->setRequired(true);
		$array_elements[] = $element;
			    
        $element = new Zend_Form_Element_Text("institucion");
	    $element->setLabel("Institución : ");
	    $element->setRequired(true);
	    $element->addFilter('StripTags');
	    $element->addFilter('StringTrim');
//	    $element->addFilter('StringToUpper');
	    $element->setAttribs(array('size'=>50));
	    $array_elements[] = $element;
	    	    
        $element = new Zend_Form_Element_Text("estadia");
        $element->setLabel("Tiempo de estadia : ");
        $element->setRequired(true);
        $element->addFilter('StripTags');
        $element->addFilter('StringTrim');
        $element->addValidator('digits');
        $element->setAttrib("size", 7);
        $array_elements[] = $element;
        
		$element = new Zend_Form_Element_Select('tipoestadia');
		$element->setLabel("Tipo de estadia :");
		$element->setRegisterInArrayValidator(false);
		$element->addMultiOption(null, "-- Seleccione --");
		$element->addMultiOptions($domConfig->TIPOESTADIA->toArray());
        $element->setRequired(true);
		$array_elements[] = $element;
        	    
        $element = new Zend_Form_Element_Textarea('actividades');
		$element->setLabel('Actividades :');
		$element->setRequired(true);
		$element->addFilter('StripTags');
		$element->addFilter('StringTrim');
//		$element->addFilter('StringToUpper');
		$element->setAttrib("rows",5);
		$element->setAttrib("style","width:99%");
		$element->setRequired(true);
		$array_elements[] = $element;
        
        $submit = new Zend_Form_Element_Submit('btnSubmit');
        $submit->setValue('Guardar');
        $submit->setLabel("Guardar");
        $submit->setAttrib("class", "iceCmdBtn");
        $array_elements[] = $submit;
       
        $this->addElements($array_elements);
        $this->loadViewScriptDecorators();
//        $this->loadTableDecorators();
    
    }

    public function loadViewScriptDecorators() {
        $this->setDecorators(array(array('viewScript',array('viewScript'=>'viewscripts/docentesvisita_form.phtml'))));
    }
}